<!--{template /module/admin/view/head}-->
<div id="left_layout">
	<div id="main_content" class="container-fluid">
		<!--{template /module/admin/view/head_nav}-->
		<div class="row-fluid">
			<div class="well widget">
				<div class="widget-header">
					<h3 class="title">{lang wx.fans.view.header}</h3>
				</div>
				<div class="widget-content">
					<form class="form-search" id="frm_search" name="frmSearch" action="{$ADMIN_SCRIPT}/wx/fans" method="post">
					<div class="action-wrapper">
						<div class="pull-left">
							<a href="javascript:void(null);" id="btn_flashlist" class="btn btn-small" {$dispatches[operations][import]}>{lang wx.fans.view.operation.fetch}</a>
						</div>
						<div class="pull-right" {$dispatches[operations][search]}>
							<div class="input-append">
								<input type="text" name="txtKeyword" value="{$_var[gp_txtKeyword]}" class="input-small search-query" />
								<button type="submit" class="btn">{lang admin.search.submit}</button>
							</div>
						</div>
					</div>
					</form>
					
					<hr/>
					<form id="frm_grid" name="frmGrid" action="{$ADMIN_SCRIPT}/wx/fans&page={$_var[page]}&psize={$_var[psize]}{$search[querystring]}" method="post">
					<input type="hidden" name="formsubmit" value="yes" />
					<table class="table table-hover">
						<thead>
							<tr>
								<th width="40">{lang wx.fans.view.th.no}</th>
								<th width="40">{lang wx.fans.view.th.photo}</th>
					            <th width="120">{lang wx.fans.view.th.nickname}</th>
					            <th width="100">{lang wx.fans.view.th.openid}</th>
					            <th width="40">{lang wx.fans.view.th.sex}</th>
					            <th>{lang wx.fans.view.th.area}</th>
					            <th width="120">{lang wx.fans.view.th.subscribe}</th>
					            <th width="60">{lang wx.fans.view.th.status}</th> 
							</tr>
						</thead>
						<tbody>
							<!--{loop $fans_list $loop $fans}-->
							<tr class="item-row">
								<td class="center">
					        		{echo $start + $loop + 1;}、
					            </td>
					            <td>
					            	<!--{if $fans[HEADIMGURL]}-->
									<img src="{$fans[HEADIMGURL]}" width="35" style="width:35px;" border="0"/>
									<!--{else}-->
									<img src="static/images/avatar.jpg" width="35" style="width:35px;" border="0"/>
									<!--{/if}-->
					            </td>
					            <td>{$fans[NICKNAME]}</td>
					            <td>{$fans[OPENID]}</td>
					            <td>
					            	<!--{if $fans['SEX'] == 1}-->{lang wx.fans.view.td.sex.man}
					            	<!--{elseif $fans['SEX'] == 2}-->{lang wx.fans.view.td.sex.woman}
					            	<!--{else}-->{lang wx.fans.view.td.sex.empty}
					            	<!--{/if}-->
					            </td>
					            <td>{$fans[COUNTRY]} {$fans[PROVINCE]} {$fans[CITY]}</td>
					            <td>
					            	<span class="f10">{echo date('Y-m-d H:i:s', $fans[SUBSCRIBE_TIME]);}</span>
					            </td>
					            <td>
					            	<!--{if $fans['SUBSCRIBE']}-->
					            	<span class="text-error">{lang wx.fans.view.td.status.subscribe}</span>
					            	<!--{else}-->
					            	{lang wx.fans.view.td.status.unsubscribe}
					            	<!--{/if}-->
					            </td>
				            </tr>
				            <!--{/loop}-->
				            <!--{if count($fans_list) == 0}-->
					        <tr>
					            <td colspan="7">
					                * {lang admin.operation.empty}
					            </td>
					        </tr>
					        <!--{/if}-->
						</tbody>
					</table>
					</form>
					
					<hr/>
					{$pager}
				</div>
			</div>
		</div>
	</div>
</div>

<script>
$(function(){
	$('.fancy').uniform();
	
	$('#btn_submit').click(function(){
		$('#frm_grid').submit();
	});
	
	$('#btn_flashlist').click(function(){
		$.dialog({submit:'{lang wx.fans.view.operation.fetch}', message:'<p>{lang wx.fans.view.operation.fetch.message}</p>', callback:function(){
			$('#modal_dialog .btn-primary').click(function(){
				$('#modal_dialog').modal('hide').remove();
				location.href = '{$ADMIN_SCRIPT}/wx/fans/_data';
			});
		}});
	});
});
</script>
<!--{template /module/admin/view/foot}-->